<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>编辑图书</title>
	<%-- 静态包含头部信息--%>
	<%@include file="/pages/common/header.jsp"%>
<style type="text/css">
	h1 {
		text-align: center;
		margin-top: 200px;
	}
	
	h1 a {
		color:red;
	}
	
	input {
		text-align: center;
	}
</style>
</head>
<body>
		<div id="header">
			<img class="logo_img" alt="" src="../../static/img/logo.gif" >
			<span class="wel_word">编辑图书</span>
			<!-- 静态包含菜单管理页面 -->
			<%@include file="/pages/common/manaer_menu.jsp"%>
		</div>
		
		<div id="main">
			<form action="manager/bookServlet" method="post">
				<!-- 判断请求请求中，是否有id， 如果有id 是修改， 如果没有id 是删除操作 -->
				<input type="hidden" name="action" value="${ empty param.id ? "add" : "update" }">
				<input type="hidden" name="id" value="${ param.id }">
				<%-- 添加隐藏域，pageNo 传入 servlet，用于添加后的显示商品添加成功  --%>
				<input type="hidden" name="pageNo" value="${param.pageNo}">
				<table>
					<tr>
						<td>名称</td>
						<td>价格</td>
						<td>作者</td>
						<td>销量</td>
						<td>库存</td>
						<td colspan="2">操作</td>
					</tr>		
					<tr>
						<td><input name="name" type="text" value="${requestScope.books.name}"/></td>
						<td><input name="price" type="text" value="${requestScope.books.price}"/></td>
						<td><input name="author" type="text" value="${requestScope.books.author}"/></td>
						<td><input name="sales" type="text" value="${requestScope.books.sales}"/></td>
						<td><input name="stock" type="text" value="${requestScope.books.stock}"/></td>
						<td><input type="submit" value="提交"/></td>
					</tr>	
				</table>
			</form>
			
	
		</div>
		<%--静态包含页脚信息--%>
		<%@include file="/pages/common/footer.jsp"%>
</body>
</html>